[org 0x7c00]

mov bp, 0x9000
mov sp, bp
mov bx, MSG_REAL_MODE
call print
call print_nl
call switch_to_pm
jmp $

%include '../chapter5/boot_sect_print.asm'
%include '32bit-gdt.asm'
%include '32bit-switch.asm'
%include '32bit-print.asm'

[bits 32]
BEGIN_PM:
    mov ebx, MSG_PROTECTED_MODE
    call print_pm
    jmp $

MSG_REAL_MODE:
    db "started in real mode", 0
MSG_PROTECTED_MODE:
    db "loaded 32-bit protected mode", 0

times 510 - ($ - $$) db 0
dw 0xaa55
